﻿namespace ACCOUNTING
{
    using ACCOUNTING.LVY.Business;
    using ACCOUNTING.My;
    using ACCOUNTING.My.Resources;
    using C1.Win.C1FlexGrid;
    using C1.Win.C1FlexGrid.Util.BaseControls;
    using Microsoft.VisualBasic;
    using Microsoft.VisualBasic.CompilerServices;
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Diagnostics;
    using System.Drawing;
    using System.Runtime.CompilerServices;
    using System.Windows.Forms;

    [DesignerGenerated]
    public class Frm_RptThuyetMinhChiPhi : Form
    {
        private static List<WeakReference> __ENCList = new List<WeakReference>();
        [AccessedThroughProperty("CbChon")]
        private CheckBox _CbChon;
        [AccessedThroughProperty("CbChonTK")]
        private CheckBox _CbChonTK;
        [AccessedThroughProperty("CboCapTaiKh")]
        private ComboBox _CboCapTaiKh;
        [AccessedThroughProperty("CboCapTaiKhoan")]
        private ComboBox _CboCapTaiKhoan;
        [AccessedThroughProperty("CboDonVi")]
        private ComboBox _CboDonVi;
        [AccessedThroughProperty("CmdCancel")]
        private Button _CmdCancel;
        [AccessedThroughProperty("CmdOK")]
        private Button _CmdOK;
        [AccessedThroughProperty("ComboBox1")]
        private ComboBox _ComboBox1;
        [AccessedThroughProperty("DateTimePicker1")]
        private DateTimePicker _DateTimePicker1;
        [AccessedThroughProperty("DateTimePicker2")]
        private DateTimePicker _DateTimePicker2;
        [AccessedThroughProperty("GroupBox2")]
        private GroupBox _GroupBox2;
        [AccessedThroughProperty("GroupBox3")]
        private GroupBox _GroupBox3;
        [AccessedThroughProperty("Label4")]
        private Label _Label4;
        [AccessedThroughProperty("Label5")]
        private Label _Label5;
        [AccessedThroughProperty("Label6")]
        private Label _Label6;
        [AccessedThroughProperty("Label7")]
        private Label _Label7;
        [AccessedThroughProperty("Label8")]
        private Label _Label8;
        [AccessedThroughProperty("RbChiTiet")]
        private RadioButton _RbChiTiet;
        [AccessedThroughProperty("RbTongHop")]
        private RadioButton _RbTongHop;
        [AccessedThroughProperty("TextBox1")]
        private TextBox _TextBox1;
        [AccessedThroughProperty("TextBox2")]
        private TextBox _TextBox2;
        [AccessedThroughProperty("TxtDenNgay")]
        private DateTimePicker _TxtDenNgay;
        [AccessedThroughProperty("TxtSearchCode")]
        private TextBox _TxtSearchCode;
        [AccessedThroughProperty("TxtSearchName")]
        private TextBox _TxtSearchName;
        [AccessedThroughProperty("TxtTuNgay")]
        private DateTimePicker _TxtTuNgay;
        [AccessedThroughProperty("VSList")]
        private C1.Win.C1FlexGrid.C1FlexGrid _VSList;
        [AccessedThroughProperty("VSlistCP")]
        private C1.Win.C1FlexGrid.C1FlexGrid _VSlistCP;
        public bool bLoaded;
        private object cFrmCall;
        private DataView cFrmData;
        private string cFrmKhoa;
        private string cFrmKhoaOld;
        private string cFrmTask;
        private IContainer components;
        private bool mAllowAdd;
        private bool mAllowDel;
        private bool mAllowEdit;
        private bool mAllowView;
        private bool mEnableControl;
        private clsDMTaiKhoan objDMTK;
        private string pKhoaDoiTuong;

        public Frm_RptThuyetMinhChiPhi()
        {
            base.Load += new EventHandler(this.Frm_RptThuyetMinhChiPhi_Load);
            List<WeakReference> list = __ENCList;
            lock (list)
            {
                __ENCList.Add(new WeakReference(this));
            }
            this.bLoaded = false;
            this.cFrmKhoaOld = "";
            this.cFrmKhoa = "";
            this.pKhoaDoiTuong = "";
            this.cFrmTask = "";
            this.objDMTK = new clsDMTaiKhoan();
            this.InitializeComponent();
        }

        private void CbChonTK_CheckedChanged(object sender, EventArgs e)
        {
            bool flag = this.CbChonTK.Checked;
            int num2 = this.VSlistCP.Rows.Count - 1;
            for (int i = 1; i <= num2; i++)
            {
                this.VSlistCP[i, 1] = flag;
            }
        }

        private void CmdCancel_Click(object sender, EventArgs e)
        {
            this.Dispose();
        }

        private void CmdOK_Click(object sender, EventArgs e)
        {
            if (this.RbTongHop.Checked & !this.RbChiTiet.Checked)
            {
                this.PrintReportTH();
            }
            else
            {
                this.PrintReportCT();
            }
        }

        [DebuggerNonUserCode]
        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void Frm_RptThuyetMinhChiPhi_Load(object sender, EventArgs e)
        {
            LVYModule.GetUserRight(ref this.mAllowView, ref this.mAllowDel, ref this.mAllowEdit, ref this.mAllowAdd, Conversions.ToString(this.Tag), modGeneral.H_USERNAME);
            if (!this.mAllowView)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn kh\x00f4ng c\x00f3 quyền xem, li\x00ean hệ với người quản trị để biết th\x00eam chi tiết.", ""));
                this.Dispose();
            }
            else
            {
                this.Cursor = Cursors.WaitCursor;
                BuildComboModule.BuildCombo(this.CboDonVi, modGeneral.ListDanhMuc.DonVi, true, "", "");
                this.CboDonVi.SelectedValue = modGeneral.H_CLIENT;
                this.CboCapTaiKh.Items.Clear();
                this.CboCapTaiKh.Items.Add(modGeneral.Tranlated("Cấp độ t\x00e0i khoản 1", ""));
                this.CboCapTaiKh.SelectedIndex = 0;
                this.TxtTuNgay.Text = "01/" + LVYModule.sRight("00" + Conversions.ToString(DateAndTime.Month(DateAndTime.Today)), 2) + "/" + Conversions.ToString(DateAndTime.Year(DateAndTime.Today));
                this.LoadData();
                this.Cursor = Cursors.Default;
            }
        }

        public DataTable GetDataPrintThuyetMinhChiPhi(string strKhoaDonVi, string strTuNgay, string strDenNgay)
        {
            DataTable table;
            IDataParameter[] commandParameters = new IDataParameter[4];
            try
            {
                commandParameters[0] = DBHelper.createParameter("@KhoaDonVi", DbType.Int64, ParameterDirection.Input, strKhoaDonVi);
                commandParameters[1] = DBHelper.createParameter("@TuNgay", DbType.Int64, ParameterDirection.Input, strTuNgay);
                commandParameters[2] = DBHelper.createParameter("@DenNgay", DbType.Int64, ParameterDirection.Input, strDenNgay);
                commandParameters[3] = DBHelper.createParameter("@Language", DbType.Int64, ParameterDirection.Input, modGeneral.H_LANGUAGE);
                table = DBHelper.ExecuteDataset(modGeneral.ConnectionString, CommandType.StoredProcedure, "BC_sp_BangKeThuyetMinhChiPhi", commandParameters).Tables[0];
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                MessageBox.Show(exception.Message);
                table = null;
                ProjectData.ClearProjectError();
                return table;
                ProjectData.ClearProjectError();
            }
            return table;
        }

        public DataTable GetDataPrintThuyetMinhCP(string strKhoaDonVi, string strTuNgay, string strDenNgay)
        {
            DataTable table;
            IDataParameter[] commandParameters = new IDataParameter[4];
            try
            {
                commandParameters[0] = DBHelper.createParameter("@KhoaDonVi", DbType.Int64, ParameterDirection.Input, strKhoaDonVi);
                commandParameters[1] = DBHelper.createParameter("@TuNgay", DbType.Int64, ParameterDirection.Input, strTuNgay);
                commandParameters[2] = DBHelper.createParameter("@DenNgay", DbType.Int64, ParameterDirection.Input, strDenNgay);
                commandParameters[3] = DBHelper.createParameter("@Language", DbType.Int64, ParameterDirection.Input, modGeneral.H_LANGUAGE);
                table = DBHelper.ExecuteDataset(modGeneral.ConnectionString, CommandType.StoredProcedure, "BC_sp_ThuyetMinhChiPhiTongHop", commandParameters).Tables[0];
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                MessageBox.Show(exception.Message);
                table = null;
                ProjectData.ClearProjectError();
                return table;
                ProjectData.ClearProjectError();
            }
            return table;
        }

        [DebuggerStepThrough]
        private void InitializeComponent()
        {
            ComponentResourceManager manager = new ComponentResourceManager(typeof(Frm_RptThuyetMinhChiPhi));
            this.RbTongHop = new RadioButton();
            this.RbChiTiet = new RadioButton();
            this.CmdCancel = new Button();
            this.CmdOK = new Button();
            this.GroupBox2 = new GroupBox();
            this.ComboBox1 = new ComboBox();
            this.Label4 = new Label();
            this.CboCapTaiKhoan = new ComboBox();
            this.CbChon = new CheckBox();
            this.TxtSearchName = new TextBox();
            this.TxtSearchCode = new TextBox();
            this.DateTimePicker1 = new DateTimePicker();
            this.DateTimePicker2 = new DateTimePicker();
            this.VSList = new C1.Win.C1FlexGrid.C1FlexGrid();
            this.GroupBox3 = new GroupBox();
            this.CboDonVi = new ComboBox();
            this.Label5 = new Label();
            this.CboCapTaiKh = new ComboBox();
            this.CbChonTK = new CheckBox();
            this.TextBox1 = new TextBox();
            this.TextBox2 = new TextBox();
            this.TxtDenNgay = new DateTimePicker();
            this.TxtTuNgay = new DateTimePicker();
            this.Label6 = new Label();
            this.Label7 = new Label();
            this.Label8 = new Label();
            this.VSlistCP = new C1.Win.C1FlexGrid.C1FlexGrid();
            this.GroupBox2.SuspendLayout();
            this.VSList.BeginInit();
            this.GroupBox3.SuspendLayout();
            this.VSlistCP.BeginInit();
            this.SuspendLayout();
            this.RbTongHop.AutoSize = true;
            Point point = new Point(0xf6, 0x62);
            this.RbTongHop.Location = point;
            this.RbTongHop.Name = "RbTongHop";
            Size size = new Size(0x4f, 0x11);
            this.RbTongHop.Size = size;
            this.RbTongHop.TabIndex = 11;
            this.RbTongHop.Text = "In tổng hợp";
            this.RbTongHop.UseVisualStyleBackColor = true;
            this.RbChiTiet.AutoSize = true;
            this.RbChiTiet.Checked = true;
            point = new Point(0x5e, 0x62);
            this.RbChiTiet.Location = point;
            this.RbChiTiet.Name = "RbChiTiet";
            size = new Size(0x44, 0x11);
            this.RbChiTiet.Size = size;
            this.RbChiTiet.TabIndex = 10;
            this.RbChiTiet.TabStop = true;
            this.RbChiTiet.Text = "In chi tiết";
            this.RbChiTiet.UseVisualStyleBackColor = true;
            this.CmdCancel.DialogResult = DialogResult.Cancel;
            this.CmdCancel.Image = (Image) manager.GetObject("CmdCancel.Image");
            this.CmdCancel.ImageAlign = ContentAlignment.MiddleLeft;
            point = new Point(0x14e, 0xa1);
            this.CmdCancel.Location = point;
            this.CmdCancel.Name = "CmdCancel";
            size = new Size(0x4f, 0x18);
            this.CmdCancel.Size = size;
            this.CmdCancel.TabIndex = 13;
            this.CmdCancel.Text = "&Tho\x00e1t";
            this.CmdCancel.UseVisualStyleBackColor = true;
            this.CmdOK.Image = (Image) manager.GetObject("CmdOK.Image");
            this.CmdOK.ImageAlign = ContentAlignment.MiddleLeft;
            point = new Point(0xfb, 0xa1);
            this.CmdOK.Location = point;
            this.CmdOK.Name = "CmdOK";
            size = new Size(0x4e, 0x18);
            this.CmdOK.Size = size;
            this.CmdOK.TabIndex = 12;
            this.CmdOK.Text = "&Chọn";
            this.CmdOK.UseVisualStyleBackColor = true;
            this.GroupBox2.Controls.Add(this.ComboBox1);
            this.GroupBox2.Controls.Add(this.Label4);
            this.GroupBox2.Controls.Add(this.CboCapTaiKhoan);
            this.GroupBox2.Controls.Add(this.CbChon);
            this.GroupBox2.Controls.Add(this.TxtSearchName);
            this.GroupBox2.Controls.Add(this.TxtSearchCode);
            this.GroupBox2.Controls.Add(this.DateTimePicker1);
            this.GroupBox2.Controls.Add(this.DateTimePicker2);
            point = new Point(0, 0);
            this.GroupBox2.Location = point;
            this.GroupBox2.Name = "GroupBox2";
            size = new Size(200, 100);
            this.GroupBox2.Size = size;
            this.GroupBox2.TabIndex = 0;
            this.GroupBox2.TabStop = false;
            this.ComboBox1.DropDownStyle = ComboBoxStyle.DropDownList;
            this.ComboBox1.FormattingEnabled = true;
            point = new Point(0x5e, 15);
            this.ComboBox1.Location = point;
            this.ComboBox1.Name = "ComboBox1";
            size = new Size(0x132, 0x15);
            this.ComboBox1.Size = size;
            this.ComboBox1.TabIndex = 0x3a;
            this.Label4.AutoSize = true;
            point = new Point(13, 0x12);
            this.Label4.Location = point;
            this.Label4.Name = "Label4";
            size = new Size(0x26, 13);
            this.Label4.Size = size;
            this.Label4.TabIndex = 0x39;
            this.Label4.Text = "Đơn vị";
            this.CboCapTaiKhoan.DropDownStyle = ComboBoxStyle.DropDownList;
            this.CboCapTaiKhoan.FormattingEnabled = true;
            point = new Point(0x5e, 0x27);
            this.CboCapTaiKhoan.Location = point;
            this.CboCapTaiKhoan.Name = "CboCapTaiKhoan";
            size = new Size(0x132, 0x15);
            this.CboCapTaiKhoan.Size = size;
            this.CboCapTaiKhoan.TabIndex = 0x38;
            this.CbChon.AutoSize = true;
            point = new Point(15, 0x5c);
            this.CbChon.Location = point;
            this.CbChon.Name = "CbChon";
            size = new Size(15, 14);
            this.CbChon.Size = size;
            this.CbChon.TabIndex = 0x37;
            this.CbChon.UseVisualStyleBackColor = true;
            point = new Point(0x80, 0x1a2);
            this.TxtSearchName.Location = point;
            this.TxtSearchName.Name = "TxtSearchName";
            size = new Size(0x13c, 20);
            this.TxtSearchName.Size = size;
            this.TxtSearchName.TabIndex = 0x34;
            point = new Point(8, 0x1a2);
            this.TxtSearchCode.Location = point;
            this.TxtSearchCode.Name = "TxtSearchCode";
            size = new Size(0x6d, 20);
            this.TxtSearchCode.Size = size;
            this.TxtSearchCode.TabIndex = 0x33;
            this.DateTimePicker1.Format = DateTimePickerFormat.Short;
            point = new Point(0x10a, 0x40);
            this.DateTimePicker1.Location = point;
            this.DateTimePicker1.Name = "DateTimePicker1";
            size = new Size(0x57, 20);
            this.DateTimePicker1.Size = size;
            this.DateTimePicker1.TabIndex = 0x2d;
            this.DateTimePicker2.Format = DateTimePickerFormat.Short;
            point = new Point(0x5e, 0x3f);
            this.DateTimePicker2.Location = point;
            this.DateTimePicker2.Name = "DateTimePicker2";
            size = new Size(0x55, 20);
            this.DateTimePicker2.Size = size;
            this.DateTimePicker2.TabIndex = 0x2c;
            DateTime time = new DateTime(0x7d7, 7, 1, 0, 0, 0, 0);
            this.DateTimePicker2.Value = time;
            this.VSList.ColumnInfo = "10,1,0,0,0,85,Columns:";
            point = new Point(0, 0);
            this.VSList.Location = point;
            this.VSList.Name = "VSList";
            this.VSList.Rows.DefaultSize = 0x11;
            size = new Size(0, 0);
            this.VSList.Size = size;
            this.VSList.StyleInfo = manager.GetString("VSList.StyleInfo");
            this.VSList.TabIndex = 0;
            this.GroupBox3.BackColor = Color.Transparent;
            this.GroupBox3.Controls.Add(this.CboDonVi);
            this.GroupBox3.Controls.Add(this.Label5);
            this.GroupBox3.Controls.Add(this.CboCapTaiKh);
            this.GroupBox3.Controls.Add(this.RbTongHop);
            this.GroupBox3.Controls.Add(this.CbChonTK);
            this.GroupBox3.Controls.Add(this.RbChiTiet);
            this.GroupBox3.Controls.Add(this.TextBox1);
            this.GroupBox3.Controls.Add(this.TextBox2);
            this.GroupBox3.Controls.Add(this.TxtDenNgay);
            this.GroupBox3.Controls.Add(this.TxtTuNgay);
            this.GroupBox3.Controls.Add(this.Label6);
            this.GroupBox3.Controls.Add(this.Label7);
            this.GroupBox3.Controls.Add(this.Label8);
            point = new Point(3, 8);
            this.GroupBox3.Location = point;
            this.GroupBox3.Name = "GroupBox3";
            size = new Size(0x19b, 0x88);
            this.GroupBox3.Size = size;
            this.GroupBox3.TabIndex = 0x37;
            this.GroupBox3.TabStop = false;
            this.GroupBox3.Text = "Tuỳ chọn";
            this.CboDonVi.DropDownStyle = ComboBoxStyle.DropDownList;
            this.CboDonVi.FormattingEnabled = true;
            point = new Point(0x5e, 0x1f);
            this.CboDonVi.Location = point;
            this.CboDonVi.Name = "CboDonVi";
            size = new Size(0x132, 0x15);
            this.CboDonVi.Size = size;
            this.CboDonVi.TabIndex = 0x3a;
            this.Label5.AutoSize = true;
            point = new Point(13, 0x22);
            this.Label5.Location = point;
            this.Label5.Name = "Label5";
            size = new Size(0x26, 13);
            this.Label5.Size = size;
            this.Label5.TabIndex = 0x39;
            this.Label5.Text = "Đơn vị";
            this.CboCapTaiKh.DropDownStyle = ComboBoxStyle.DropDownList;
            this.CboCapTaiKh.FormattingEnabled = true;
            point = new Point(80, 0x91);
            this.CboCapTaiKh.Location = point;
            this.CboCapTaiKh.Name = "CboCapTaiKh";
            size = new Size(0x132, 0x15);
            this.CboCapTaiKh.Size = size;
            this.CboCapTaiKh.TabIndex = 0x38;
            this.CbChonTK.AutoSize = true;
            point = new Point(0x11, 0xe2);
            this.CbChonTK.Location = point;
            this.CbChonTK.Name = "CbChonTK";
            size = new Size(15, 14);
            this.CbChonTK.Size = size;
            this.CbChonTK.TabIndex = 0x37;
            this.CbChonTK.UseVisualStyleBackColor = true;
            point = new Point(0x80, 0x19f);
            this.TextBox1.Location = point;
            this.TextBox1.Name = "TextBox1";
            size = new Size(0x13c, 20);
            this.TextBox1.Size = size;
            this.TextBox1.TabIndex = 0x34;
            point = new Point(6, 0x19f);
            this.TextBox2.Location = point;
            this.TextBox2.Name = "TextBox2";
            size = new Size(0x7a, 20);
            this.TextBox2.Size = size;
            this.TextBox2.TabIndex = 0x33;
            this.TxtDenNgay.Format = DateTimePickerFormat.Short;
            point = new Point(0x138, 0x40);
            this.TxtDenNgay.Location = point;
            this.TxtDenNgay.Name = "TxtDenNgay";
            size = new Size(0x57, 20);
            this.TxtDenNgay.Size = size;
            this.TxtDenNgay.TabIndex = 0x2d;
            this.TxtTuNgay.Format = DateTimePickerFormat.Short;
            point = new Point(0x5e, 0x3f);
            this.TxtTuNgay.Location = point;
            this.TxtTuNgay.Name = "TxtTuNgay";
            size = new Size(0x55, 20);
            this.TxtTuNgay.Size = size;
            this.TxtTuNgay.TabIndex = 0x2c;
            time = new DateTime(0x7d7, 7, 1, 0, 0, 0, 0);
            this.TxtTuNgay.Value = time;
            this.Label6.AutoSize = true;
            point = new Point(14, 0x44);
            this.Label6.Location = point;
            this.Label6.Name = "Label6";
            size = new Size(0x2e, 13);
            this.Label6.Size = size;
            this.Label6.TabIndex = 0x2e;
            this.Label6.Text = "Từ ng\x00e0y";
            this.Label7.AutoSize = true;
            point = new Point(-1, 0x94);
            this.Label7.Location = point;
            this.Label7.Name = "Label7";
            size = new Size(0x49, 13);
            this.Label7.Size = size;
            this.Label7.TabIndex = 0x31;
            this.Label7.Text = "Cấp t\x00e0i khoản";
            this.Label8.AutoSize = true;
            point = new Point(0xf3, 0x43);
            this.Label8.Location = point;
            this.Label8.Name = "Label8";
            size = new Size(0x35, 13);
            this.Label8.Size = size;
            this.Label8.TabIndex = 0x2f;
            this.Label8.Text = "Đến ng\x00e0y";
            this.VSlistCP.AutoResize = false;
            this.VSlistCP.BackColor = Color.WhiteSmoke;
            this.VSlistCP.BorderStyle = C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.Light3D;
            this.VSlistCP.ColumnInfo = manager.GetString("VSlistCP.ColumnInfo");
            this.VSlistCP.ExtendLastCol = true;
            this.VSlistCP.FocusRect = FocusRectEnum.None;
            point = new Point(8, 0xf8);
            this.VSlistCP.Location = point;
            this.VSlistCP.Name = "VSlistCP";
            this.VSlistCP.Rows.Count = 1;
            this.VSlistCP.Rows.DefaultSize = 0x11;
            this.VSlistCP.SelectionMode = SelectionModeEnum.Row;
            size = new Size(0x1b7, 0x145);
            this.VSlistCP.Size = size;
            this.VSlistCP.StyleInfo = manager.GetString("VSlistCP.StyleInfo");
            this.VSlistCP.TabIndex = 50;
            SizeF ef = new SizeF(6f, 13f);
            this.AutoScaleDimensions = ef;
            this.AutoScaleMode = AutoScaleMode.Font;
            this.BackgroundImage = ACCOUNTING.My.Resources.Resources.background;
            size = new Size(0x1a1, 0xc3);
            this.ClientSize = size;
            this.ControlBox = false;
            this.Controls.Add(this.GroupBox3);
            this.Controls.Add(this.CmdCancel);
            this.Controls.Add(this.CmdOK);
            this.Controls.Add(this.VSlistCP);
            this.FormBorderStyle = FormBorderStyle.FixedDialog;
            this.Name = "Frm_RptThuyetMinhChiPhi";
            this.StartPosition = FormStartPosition.CenterScreen;
            this.Tag = "BC-0011             ";
            this.Text = "BAO CAO THUYET MINH CHI PHI";
            this.GroupBox2.ResumeLayout(false);
            this.GroupBox2.PerformLayout();
            this.VSList.EndInit();
            this.GroupBox3.ResumeLayout(false);
            this.GroupBox3.PerformLayout();
            this.VSlistCP.EndInit();
            this.ResumeLayout(false);
        }

        public void LoadData()
        {
            this.cFrmData = new DataView(this.objDMTK.ShowListByField("Khoa|0 as Chon|SoTaiKhoan|Ten" + modGeneral.H_LANGUAGE + "", " CapDo = '1' And Left(SoTaiKhoan,3) in('627','641','642')", ""));
            if (this.cFrmData != null)
            {
                this.VSlistCP.DataSource = this.cFrmData;
                C1.Win.C1FlexGrid.C1FlexGrid vSlistCP = this.VSlistCP;
                vSlistCP[0, 1] = "";
                vSlistCP[0, 2] = modGeneral.Tranlated("Số t\x00e0i khoản", "");
                vSlistCP[0, 3] = modGeneral.Tranlated("T\x00ean t\x00e0i khoản", "");
                vSlistCP.Cols[0].Visible = false;
                vSlistCP.Cols[1].DataType = System.Type.GetType("System.Boolean");
                vSlistCP.Cols[1].Width = 30;
                vSlistCP = null;
            }
        }

        public void PrintReportCT()
        {
            this.Cursor = Cursors.WaitCursor;
            DataTable dataTable = this.GetDataPrintThuyetMinhChiPhi(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboDonVi.SelectedValue), "", modGeneral.TypeOfValue.Nothing).ToString().Trim(), LVYModule.Date2Char(this.TxtTuNgay.Text), LVYModule.Date2Char(this.TxtDenNgay.Text));
            if (dataTable.Rows.Count == 0)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Kh\x00f4ng c\x00f3 dữ liệu !", ""));
            }
            else
            {
                Rpt_ThuyetMinhChiPhi phi = new Rpt_ThuyetMinhChiPhi();
                try
                {
                    phi.SetDataSource(dataTable);
                    if (modGeneral.H_LANGUAGE == "VIET")
                    {
                        phi.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEVIET, ""));
                    }
                    else
                    {
                        phi.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEANH, ""));
                    }
                    phi.SetParameterValue(1, modGeneral.Tranlated("Địa chỉ", "") + ": " + modGeneral.H_ADDRESS);
                    phi.SetParameterValue(2, modGeneral.Tranlated("M\x00e3 số thuế", "") + ": " + modGeneral.H_TAXCODE);
                    phi.SetParameterValue(3, modGeneral.Tranlated("Điện thoại", "") + ": " + modGeneral.H_TELEPHONE);
                    phi.SetParameterValue(4, modGeneral.Tranlated("Fax", "") + ": " + modGeneral.H_FAX);
                    phi.SetParameterValue(5, modGeneral.Tranlated("CHI PH\x00cd THEO KHOẢN MỤC PH\x00cd (CHI TIẾT)", ""));
                    phi.SetParameterValue(6, modGeneral.Tranlated("Từ ng\x00e0y", "") + " : " + this.TxtTuNgay.Text);
                    phi.SetParameterValue(7, modGeneral.Tranlated("Đến ng\x00e0y", "") + " : " + this.TxtDenNgay.Text);
                    phi.SetParameterValue(8, modGeneral.Tranlated("Tk c\x00f3 : 136;131;331;214;431;311;3334;111;112;141;142", ""));
                    phi.SetParameterValue(9, modGeneral.Tranlated("Tk nợ : 627;641;642", ""));
                    phi.SetParameterValue(10, modGeneral.Tranlated("Chứng từ", ""));
                    phi.SetParameterValue(11, modGeneral.Tranlated("Diễn giải", ""));
                    phi.SetParameterValue(12, modGeneral.Tranlated("T\x00e0i khoản", ""));
                    phi.SetParameterValue(13, modGeneral.Tranlated("Tiền", ""));
                    phi.SetParameterValue(14, modGeneral.Tranlated("Tổng cộng", ""));
                    phi.SetParameterValue(15, modGeneral.Tranlated("Kế to\x00e1n trưởng", ""));
                    phi.SetParameterValue(0x10, modGeneral.Tranlated("Ng\x00e0y .... th\x00e1ng .... năm ............", ""));
                    phi.SetParameterValue(0x11, modGeneral.Tranlated("Người lập biểu", ""));
                    phi.SetParameterValue(0x12, modGeneral.Tranlated("Chi ph\x00ed", ""));
                    MyProject.Forms.Frm_ViewReport.ReportViewer.ReportSource = phi;
                    MyProject.Forms.Frm_ViewReport.ReportViewer.DisplayGroupTree = false;
                    this.Cursor = Cursors.Default;
                    MyProject.Forms.Frm_ViewReport.ShowDialog();
                }
                catch (Exception exception1)
                {
                    ProjectData.SetProjectError(exception1);
                    Exception exception = exception1;
                    MessageBox.Show(exception.Message.ToString());
                    ProjectData.ClearProjectError();
                }
            }
        }

        public void PrintReportTH()
        {
            this.Cursor = Cursors.WaitCursor;
            DataTable dataTable = this.GetDataPrintThuyetMinhCP(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboDonVi.SelectedValue), "", modGeneral.TypeOfValue.Nothing).ToString().Trim(), LVYModule.Date2Char(this.TxtTuNgay.Text), LVYModule.Date2Char(this.TxtDenNgay.Text));
            if (dataTable.Rows.Count == 0)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Kh\x00f4ng c\x00f3 dữ liệu !", ""));
            }
            else
            {
                Rpt_ThuyetMinhChiPhiTH ith = new Rpt_ThuyetMinhChiPhiTH();
                try
                {
                    ith.SetDataSource(dataTable);
                    if (modGeneral.H_LANGUAGE == "VIET")
                    {
                        ith.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEVIET, ""));
                    }
                    else
                    {
                        ith.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEANH, ""));
                    }
                    ith.SetParameterValue(1, modGeneral.Tranlated("Địa chỉ", "") + ": " + modGeneral.H_ADDRESS);
                    ith.SetParameterValue(2, modGeneral.Tranlated("M\x00e3 số thuế", "") + ": " + modGeneral.H_TAXCODE);
                    ith.SetParameterValue(3, modGeneral.Tranlated("Điện thoại", "") + ": " + modGeneral.H_TELEPHONE);
                    ith.SetParameterValue(4, modGeneral.Tranlated("Fax", "") + ": " + modGeneral.H_FAX);
                    ith.SetParameterValue(5, modGeneral.Tranlated("BẢNG TỔNG HỢP THUYẾT MINH CHI PH\x00cd", ""));
                    ith.SetParameterValue(6, modGeneral.Tranlated("Từ ng\x00e0y", "") + " : " + this.TxtTuNgay.Text);
                    ith.SetParameterValue(7, modGeneral.Tranlated("Đến ng\x00e0y", "") + " : " + this.TxtDenNgay.Text);
                    ith.SetParameterValue(8, modGeneral.Tranlated("Tk c\x00f3 : 136;131;331;214;431;311;3334;111;112;141;142", ""));
                    ith.SetParameterValue(9, modGeneral.Tranlated("Tk nợ : 627;641;642", ""));
                    ith.SetParameterValue(10, modGeneral.Tranlated("Nội dung", ""));
                    ith.SetParameterValue(11, modGeneral.Tranlated("Số tiền T.Khoản", ""));
                    ith.SetParameterValue(12, modGeneral.Tranlated("Số tiền K.mục", ""));
                    ith.SetParameterValue(13, modGeneral.Tranlated("Bao gồm :", ""));
                    ith.SetParameterValue(14, modGeneral.Tranlated("Trong đ\x00f3 :", ""));
                    ith.SetParameterValue(15, modGeneral.Tranlated("Kế to\x00e1n trưởng", ""));
                    ith.SetParameterValue(0x10, modGeneral.Tranlated("Ng\x00e0y .... th\x00e1ng .... năm ............", ""));
                    ith.SetParameterValue(0x11, modGeneral.Tranlated("Người lập biểu", ""));
                    ith.SetParameterValue(0x12, modGeneral.Tranlated("Tổng cộng", ""));
                    MyProject.Forms.Frm_ViewReport.ReportViewer.ReportSource = ith;
                    MyProject.Forms.Frm_ViewReport.ReportViewer.DisplayGroupTree = false;
                    this.Cursor = Cursors.Default;
                    MyProject.Forms.Frm_ViewReport.ShowDialog();
                }
                catch (Exception exception1)
                {
                    ProjectData.SetProjectError(exception1);
                    Exception exception = exception1;
                    MessageBox.Show(exception.Message.ToString());
                    ProjectData.ClearProjectError();
                }
            }
        }

        public void SearchTaiKhoan(string field, string str)
        {
            string str2 = field + " LIKE '" + str + "%'";
            this.cFrmData.RowFilter = str2;
            if (this.VSList.Rows.Count != 1)
            {
                this.VSList.Select(1, 0, 1, this.VSList.Cols.Count - 1);
            }
        }

        private void TextBox1_TextChanged(object sender, EventArgs e)
        {
            this.SearchTaiKhoan("TenViet", this.TxtSearchName.Text);
        }

        private void TextBox2_TextChanged(object sender, EventArgs e)
        {
            this.SearchTaiKhoan("SoTaiKhoan", this.TxtSearchCode.Text);
        }

        private void TxtTuNgay_LostFocus(object sender, EventArgs e)
        {
            if (LVYModule.sRight(this.TxtTuNgay.Text, 7) != LVYModule.sRight(this.TxtDenNgay.Text, 7))
            {
                this.TxtDenNgay.Text = DateTime.DaysInMonth(Conversions.ToInteger(LVYModule.sRight(this.TxtTuNgay.Text, 4)), Conversions.ToInteger(LVYModule.sMid(this.TxtTuNgay.Text, 4, 2))).ToString() + "/" + LVYModule.sRight(this.TxtTuNgay.Text, 7);
            }
        }

        internal virtual CheckBox CbChon
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CbChon;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CbChon = value;
            }
        }

        internal virtual CheckBox CbChonTK
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CbChonTK;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CbChonTK_CheckedChanged);
                if (this._CbChonTK != null)
                {
                    this._CbChonTK.CheckedChanged -= handler;
                }
                this._CbChonTK = value;
                if (this._CbChonTK != null)
                {
                    this._CbChonTK.CheckedChanged += handler;
                }
            }
        }

        internal virtual ComboBox CboCapTaiKh
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboCapTaiKh;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CboCapTaiKh = value;
            }
        }

        internal virtual ComboBox CboCapTaiKhoan
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboCapTaiKhoan;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CboCapTaiKhoan = value;
            }
        }

        internal virtual ComboBox CboDonVi
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboDonVi;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CboDonVi = value;
            }
        }

        internal virtual Button CmdCancel
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdCancel;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdCancel_Click);
                if (this._CmdCancel != null)
                {
                    this._CmdCancel.Click -= handler;
                }
                this._CmdCancel = value;
                if (this._CmdCancel != null)
                {
                    this._CmdCancel.Click += handler;
                }
            }
        }

        internal virtual Button CmdOK
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdOK;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdOK_Click);
                if (this._CmdOK != null)
                {
                    this._CmdOK.Click -= handler;
                }
                this._CmdOK = value;
                if (this._CmdOK != null)
                {
                    this._CmdOK.Click += handler;
                }
            }
        }

        internal virtual ComboBox ComboBox1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ComboBox1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ComboBox1 = value;
            }
        }

        internal virtual DateTimePicker DateTimePicker1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._DateTimePicker1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._DateTimePicker1 = value;
            }
        }

        internal virtual DateTimePicker DateTimePicker2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._DateTimePicker2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._DateTimePicker2 = value;
            }
        }

        internal virtual GroupBox GroupBox2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._GroupBox2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._GroupBox2 = value;
            }
        }

        internal virtual GroupBox GroupBox3
        {
            [DebuggerNonUserCode]
            get
            {
                return this._GroupBox3;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._GroupBox3 = value;
            }
        }

        internal virtual Label Label4
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label4;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label4 = value;
            }
        }

        internal virtual Label Label5
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label5;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label5 = value;
            }
        }

        internal virtual Label Label6
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label6;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label6 = value;
            }
        }

        internal virtual Label Label7
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label7;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label7 = value;
            }
        }

        internal virtual Label Label8
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label8;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label8 = value;
            }
        }

        internal virtual RadioButton RbChiTiet
        {
            [DebuggerNonUserCode]
            get
            {
                return this._RbChiTiet;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._RbChiTiet = value;
            }
        }

        internal virtual RadioButton RbTongHop
        {
            [DebuggerNonUserCode]
            get
            {
                return this._RbTongHop;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._RbTongHop = value;
            }
        }

        internal virtual TextBox TextBox1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TextBox1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.TextBox1_TextChanged);
                if (this._TextBox1 != null)
                {
                    this._TextBox1.TextChanged -= handler;
                }
                this._TextBox1 = value;
                if (this._TextBox1 != null)
                {
                    this._TextBox1.TextChanged += handler;
                }
            }
        }

        internal virtual TextBox TextBox2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TextBox2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.TextBox2_TextChanged);
                if (this._TextBox2 != null)
                {
                    this._TextBox2.TextChanged -= handler;
                }
                this._TextBox2 = value;
                if (this._TextBox2 != null)
                {
                    this._TextBox2.TextChanged += handler;
                }
            }
        }

        internal virtual DateTimePicker TxtDenNgay
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtDenNgay;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtDenNgay = value;
            }
        }

        internal virtual TextBox TxtSearchCode
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSearchCode;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtSearchCode = value;
            }
        }

        internal virtual TextBox TxtSearchName
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSearchName;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtSearchName = value;
            }
        }

        internal virtual DateTimePicker TxtTuNgay
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTuNgay;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.TxtTuNgay_LostFocus);
                if (this._TxtTuNgay != null)
                {
                    this._TxtTuNgay.LostFocus -= handler;
                }
                this._TxtTuNgay = value;
                if (this._TxtTuNgay != null)
                {
                    this._TxtTuNgay.LostFocus += handler;
                }
            }
        }

        internal virtual C1.Win.C1FlexGrid.C1FlexGrid VSList
        {
            [DebuggerNonUserCode]
            get
            {
                return this._VSList;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._VSList = value;
            }
        }

        internal virtual C1.Win.C1FlexGrid.C1FlexGrid VSlistCP
        {
            [DebuggerNonUserCode]
            get
            {
                return this._VSlistCP;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._VSlistCP = value;
            }
        }
    }
}

